#include <iostream>
#include <string>

using  namespace std;

int main()
{
    int c = 0;
    string s = "()(())()";
    string st = "";
    for (char i: s){
            if (i == '(') st = st + i;
            else
               if (st[st.length()-1] == '(') st.pop_back();
        else break;
    }
if (st.length() == 0)
    cout << "true";

}
